<template>
	<view class="goods-list">
		<view class="goods-item" v-for="(item, index) in goodsList" :key="index" @click="navigator(item.id)">
			<image :src="item.img_url" mode=""></image>
			<view class="price">
				<text>￥{{item.sell_price}}</text>
				<text>￥{{item.market_price}}</text>
			</view>
			<view class="name">
				{{item.title}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['goodsList'],
		data() {
			return {
				
			};
		},
		methods: {
			navigator(id) {
				this.$emit('clickGoodsItem',id)
			}
		}
	}
</script>

<style lang="scss">
	.goods-list {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		padding: 0 15rpx;
		.goods-item {
			background-color: #fff;
			width: 355rpx;
			margin: 10rpx 0;
			padding: 15rpx;
			box-sizing: border-box;
			image {
				width: 80%;
				height: 150px;
				display: block;
				margin: auto;
			}
			.price {
				color: $shop-color;
				font-size: 36rpx;
				margin-top: 15rpx;
				text:nth-child(2) {
					color: #ccc;
					font-size: 28rpx;
					margin-left: 7rpx;
					text-decoration: line-through;
				}
			}
			.name {
				font-size: 28rpx;
				line-height: 50rpx;
				padding-top: 10rpx;
				padding-bottom: 15rpx;
				display: -webkit-box;
				-webkit-line-clamp:2;
				overflow: hidden;
				text-overflow: ellipsis;
				-webkit-box-orient: vertical;
			}
		}
	}
</style>
